package com.renchunlin.flow

import android.os.Bundle
import android.util.Log
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.renchunlin.flow.bean.Item
import com.renchunlin.flow.view.FlowLayout

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val flowLayout: FlowLayout = findViewById(R.id.flow_layout)
        /*val list = mutableListOf<String>("键盘", "显示器", "鼠标", "主机箱", "ipad","蛋糕"
            ,"吸尘器","空调","电视机","牙刷","水杯","书包","筷子","游戏机","冰箱")*/
        val list = mutableListOf<Item>(
            Item("1月", false),
            Item("2月", false),
            Item("3月", false),
            Item("4月", false),
            Item("个人个人我个人哥哥违规而改为如果微软歌热舞Greg我隔热隔热我为退热贴各位热舞挺好", false),
            Item("6月", false),
            Item("7月", false),
            Item("8月", false),
            Item("9月", false),
            Item("10月", false),
            Item("11月", false),
            Item("12月", false)
        )
        flowLayout.textList(list)

        flowLayout.setItemClickListener(object : FlowLayout.ItemClickListener {
            override fun itemClick(v: View, content: String) {
                Log.i("chen", "itemClick: $content")
            }
        })

        flowLayout.maxLine = -1
    }
}